/**
 * 
 */
package registnet.courseDemand;

import java.util.ArrayList;
import java.util.List;

/**
 * The time and days pair. The time is in int[2] format that corresponds to the
 * start and end time. The days is a List<Integer> corresponding to the days of
 * the week. The format is done to be easily used in the matrix schedule
 * 
 * @author Dexter Ryan Carrasco
 */
public class SchedulePair implements CourseDemandConstants {

	/** The time in schedule matrix format */
	private int[] timeInt;

	/** The days in schedule matrix format */
	private List<Integer> daysInt;

	/** Default Constructor of SchedulePair */
	public SchedulePair() {
		this.daysInt = new ArrayList<Integer>();
	}

	/**
	 * Constructor with days and time specified
	 * 
	 * @param daysInt
	 * @param timeInt
	 */
	public SchedulePair(final List<Integer> daysInt, final int[] timeInt) {
		this.timeInt = timeInt;
		this.daysInt = new ArrayList<Integer>();
		this.daysInt.addAll(daysInt);
	}

	/**
	 * Adds a day to the schedule pair
	 * 
	 * @param day
	 */
	public void addDay(final int day) {
		if (day >= MONDAY && day <= SATURDAY && !this.daysInt.contains(day)) {
			this.daysInt.add(day);
		}
	}

	/**
	 * Gets the days in the schedule pair
	 * 
	 * @return the daysInt
	 */
	public List<Integer> getDaysInt() {
		return this.daysInt;
	}

	/**
	 * Gets the time in the schedule pair
	 * 
	 * @return the timeInt
	 */
	public int[] getTimeInt() {
		return this.timeInt;
	}

	/**
	 * Sets the days in the schedule pair
	 * 
	 * @param daysInt
	 *            the daysInt to set
	 */
	public void setDaysInt(final List<Integer> daysInt) {
		this.daysInt = new ArrayList<Integer>();
		this.daysInt.addAll(daysInt);
	}

	/**
	 * Sets the time in the schedule pair
	 * 
	 * @param timeInt
	 *            the timeInt to set
	 */
	public void setTimeInt(final int[] timeInt) {
		this.timeInt = timeInt;
	}

}
